<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

<ui:composition>
    <p:panel id="pnlKeyResponse" header="Chaves de reposta" widgetVar="panelKeyResponse">

        <p:dataTable id="dataTableKeyResponse" var="keyResponse" value="#{clientDashboardMBean.listKeyResponse}" rowKey="#{keyResponse.pkKeyResponse}" selection="#{clientDashboardMBean.selectedKeyResponse}"
                     selectionMode="single" paginator="true" rows="10" dynamic="true" paginatorPosition="top" update="panel_edit_key_response">

            <p:column>
                <f:facet name="header">Padrão</f:facet>
                <h:outputText value="#{keyResponse.defaultKey}"/>
            </p:column>

            <p:column>
                <f:facet name="header">Name</f:facet>
                <h:outputText value="#{keyResponse.name}"/>
            </p:column>

            <p:column>
                <f:facet name="header">Dica</f:facet>
                <h:outputText value="#{keyResponse.tip}"/>
            </p:column>
        </p:dataTable>

        <p:commandButton id="btnCreateKeyResponse" value="Criar" styleClass="btn" onclick="create_key_response.show()"/>
        <p:commandButton id="btnEditKeyResponse" value="Editar" styleClass="btn" onclick="edit_key_response.show()"/>
        <p:commandButton id="btnRemoveKeyResponse" value="Apagar" styleClass="btn" actionListener="#{clientDashboardMBean.removeKeyResponse}" update="pnlKeyResponse"/>
    </p:panel>
</ui:composition>
</html>